3.3.57 \(\int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx\) [257]

3.3.57.1 Optimal result
3.3.57.2 Mathematica [A] (verified)
3.3.57.3 Rubi [A] (verified)
3.3.57.4 Maple [A] (verified)
3.3.57.5 Fricas [A] (verification not implemented)
3.3.57.6 Sympy [B] (verification not implemented)
3.3.57.7 Maxima [B] (verification not implemented)
3.3.57.8 Giac [B] (verification not implemented)
3.3.57.9 Mupad [B] (verification not implemented)

3.3.57.1 Optimal result

Integrand size = 28, antiderivative size = 99 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {(e+f x)^4}{4 a f}-\frac {6 f^2 (e+f x) \cos (c+d x)}{a d^3}+\frac {(e+f x)^3 \cos (c+d x)}{a d}+\frac {6 f^3 \sin (c+d x)}{a d^4}-\frac {3 f (e+f x)^2 \sin (c+d x)}{a d^2} \]

output
1/4*(f*x+e)^4/a/f-6*f^2*(f*x+e)*cos(d*x+c)/a/d^3+(f*x+e)^3*cos(d*x+c)/a/d+ 
6*f^3*sin(d*x+c)/a/d^4-3*f*(f*x+e)^2*sin(d*x+c)/a/d^2
 
3.3.57.2 Mathematica [A] (verified)

Time = 0.91 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.03 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^4 x \left (4 e^3+6 e^2 f x+4 e f^2 x^2+f^3 x^3\right )+4 d (e+f x) \left (-6 f^2+d^2 (e+f x)^2\right ) \cos (c+d x)-12 f \left (-2 f^2+d^2 (e+f x)^2\right ) \sin (c+d x)}{4 a d^4} \]

input
Integrate[((e + f*x)^3*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
 
output
(d^4*x*(4*e^3 + 6*e^2*f*x + 4*e*f^2*x^2 + f^3*x^3) + 4*d*(e + f*x)*(-6*f^2 
 + d^2*(e + f*x)^2)*Cos[c + d*x] - 12*f*(-2*f^2 + d^2*(e + f*x)^2)*Sin[c + 
 d*x])/(4*a*d^4)
 
3.3.57.3 Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.01, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.393, Rules used = {5034, 17, 3042, 3777, 3042, 3777, 25, 3042, 3777, 3042, 3117}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 5034

\(\displaystyle \frac {\int (e+f x)^3dx}{a}-\frac {\int (e+f x)^3 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 17

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\int (e+f x)^3 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\int (e+f x)^3 \sin (c+d x)dx}{a}\)

\(\Big \downarrow \) 3777

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \int (e+f x)^2 \cos (c+d x)dx}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \int (e+f x)^2 \sin \left (c+d x+\frac {\pi }{2}\right )dx}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3777

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {2 f \int -((e+f x) \sin (c+d x))dx}{d}+\frac {(e+f x)^2 \sin (c+d x)}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {(e+f x)^2 \sin (c+d x)}{d}-\frac {2 f \int (e+f x) \sin (c+d x)dx}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {(e+f x)^2 \sin (c+d x)}{d}-\frac {2 f \int (e+f x) \sin (c+d x)dx}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3777

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {(e+f x)^2 \sin (c+d x)}{d}-\frac {2 f \left (\frac {f \int \cos (c+d x)dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}\right )}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {(e+f x)^2 \sin (c+d x)}{d}-\frac {2 f \left (\frac {f \int \sin \left (c+d x+\frac {\pi }{2}\right )dx}{d}-\frac {(e+f x) \cos (c+d x)}{d}\right )}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

\(\Big \downarrow \) 3117

\(\displaystyle \frac {(e+f x)^4}{4 a f}-\frac {\frac {3 f \left (\frac {(e+f x)^2 \sin (c+d x)}{d}-\frac {2 f \left (\frac {f \sin (c+d x)}{d^2}-\frac {(e+f x) \cos (c+d x)}{d}\right )}{d}\right )}{d}-\frac {(e+f x)^3 \cos (c+d x)}{d}}{a}\)

input
Int[((e + f*x)^3*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]
 
output
(e + f*x)^4/(4*a*f) - (-(((e + f*x)^3*Cos[c + d*x])/d) + (3*f*(((e + f*x)^ 
2*Sin[c + d*x])/d - (2*f*(-(((e + f*x)*Cos[c + d*x])/d) + (f*Sin[c + d*x]) 
/d^2))/d))/d)/a
 

3.3.57.3.1 Defintions of rubi rules used

rule 17
Int[(c_.)*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[c*((a + b*x)^(m + 1 
)/(b*(m + 1))), x] /; FreeQ[{a, b, c, m}, x] && NeQ[m, -1]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3117
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; 
 FreeQ[{c, d}, x]
 

rule 3777
Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[( 
-(c + d*x)^m)*(Cos[e + f*x]/f), x] + Simp[d*(m/f)   Int[(c + d*x)^(m - 1)*C 
os[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
 

rule 5034
Int[(Cos[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.) 
*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[1/a   Int[(e + f*x)^m*Cos[c + 
d*x]^(n - 2), x], x] - Simp[1/b   Int[(e + f*x)^m*Cos[c + d*x]^(n - 2)*Sin[ 
c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^ 
2 - b^2, 0]
 
3.3.57.4 Maple [A] (verified)

Time = 0.29 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.09

method result size
parallelrisch \(\frac {\left (\left (f x +e \right )^{2} d^{2}-6 f^{2}\right ) \left (f x +e \right ) d \cos \left (d x +c \right )-3 f \left (\left (f x +e \right )^{2} d^{2}-2 f^{2}\right ) \sin \left (d x +c \right )+\left (\left (\frac {f x}{2}+e \right ) x \left (\frac {1}{2} x^{2} f^{2}+f e x +e^{2}\right ) d^{3}+d^{2} e^{3}-6 e \,f^{2}\right ) d}{a \,d^{4}}\) \(108\)
risch \(\frac {f^{3} x^{4}}{4 a}+\frac {f^{2} e \,x^{3}}{a}+\frac {3 f \,e^{2} x^{2}}{2 a}+\frac {e^{3} x}{a}+\frac {e^{4}}{4 a f}+\frac {\left (d^{2} x^{3} f^{3}+3 d^{2} e \,f^{2} x^{2}+3 d^{2} e^{2} f x +d^{2} e^{3}-6 f^{3} x -6 e \,f^{2}\right ) \cos \left (d x +c \right )}{d^{3} a}-\frac {3 f \left (d^{2} x^{2} f^{2}+2 f e x \,d^{2}+d^{2} e^{2}-2 f^{2}\right ) \sin \left (d x +c \right )}{a \,d^{4}}\) \(166\)
derivativedivides \(\frac {-\cos \left (d x +c \right ) c^{3} f^{3}+3 \cos \left (d x +c \right ) c^{2} d e \,f^{2}-3 c^{2} f^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-3 \cos \left (d x +c \right ) c \,d^{2} e^{2} f +6 c d e \,f^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )+3 c \,f^{3} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )+\cos \left (d x +c \right ) d^{3} e^{3}-3 d^{2} e^{2} f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-3 d e \,f^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )-f^{3} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )-c^{3} f^{3} \left (d x +c \right )+3 c^{2} d e \,f^{2} \left (d x +c \right )+\frac {3 c^{2} f^{3} \left (d x +c \right )^{2}}{2}-3 c \,d^{2} e^{2} f \left (d x +c \right )-3 c d e \,f^{2} \left (d x +c \right )^{2}-c \,f^{3} \left (d x +c \right )^{3}+d^{3} e^{3} \left (d x +c \right )+\frac {3 d^{2} e^{2} f \left (d x +c \right )^{2}}{2}+d e \,f^{2} \left (d x +c \right )^{3}+\frac {f^{3} \left (d x +c \right )^{4}}{4}}{d^{4} a}\) \(436\)
default \(\frac {-\cos \left (d x +c \right ) c^{3} f^{3}+3 \cos \left (d x +c \right ) c^{2} d e \,f^{2}-3 c^{2} f^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-3 \cos \left (d x +c \right ) c \,d^{2} e^{2} f +6 c d e \,f^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )+3 c \,f^{3} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )+\cos \left (d x +c \right ) d^{3} e^{3}-3 d^{2} e^{2} f \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )-3 d e \,f^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )-f^{3} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )-c^{3} f^{3} \left (d x +c \right )+3 c^{2} d e \,f^{2} \left (d x +c \right )+\frac {3 c^{2} f^{3} \left (d x +c \right )^{2}}{2}-3 c \,d^{2} e^{2} f \left (d x +c \right )-3 c d e \,f^{2} \left (d x +c \right )^{2}-c \,f^{3} \left (d x +c \right )^{3}+d^{3} e^{3} \left (d x +c \right )+\frac {3 d^{2} e^{2} f \left (d x +c \right )^{2}}{2}+d e \,f^{2} \left (d x +c \right )^{3}+\frac {f^{3} \left (d x +c \right )^{4}}{4}}{d^{4} a}\) \(436\)
norman \(\text {Expression too large to display}\) \(936\)

input
int((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)
 
output
(((f*x+e)^2*d^2-6*f^2)*(f*x+e)*d*cos(d*x+c)-3*f*((f*x+e)^2*d^2-2*f^2)*sin( 
d*x+c)+((1/2*f*x+e)*x*(1/2*x^2*f^2+f*e*x+e^2)*d^3+d^2*e^3-6*e*f^2)*d)/a/d^ 
4
 
3.3.57.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.59 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {d^{4} f^{3} x^{4} + 4 \, d^{4} e f^{2} x^{3} + 6 \, d^{4} e^{2} f x^{2} + 4 \, d^{4} e^{3} x + 4 \, {\left (d^{3} f^{3} x^{3} + 3 \, d^{3} e f^{2} x^{2} + d^{3} e^{3} - 6 \, d e f^{2} + 3 \, {\left (d^{3} e^{2} f - 2 \, d f^{3}\right )} x\right )} \cos \left (d x + c\right ) - 12 \, {\left (d^{2} f^{3} x^{2} + 2 \, d^{2} e f^{2} x + d^{2} e^{2} f - 2 \, f^{3}\right )} \sin \left (d x + c\right )}{4 \, a d^{4}} \]

input
integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")
 
output
1/4*(d^4*f^3*x^4 + 4*d^4*e*f^2*x^3 + 6*d^4*e^2*f*x^2 + 4*d^4*e^3*x + 4*(d^ 
3*f^3*x^3 + 3*d^3*e*f^2*x^2 + d^3*e^3 - 6*d*e*f^2 + 3*(d^3*e^2*f - 2*d*f^3 
)*x)*cos(d*x + c) - 12*(d^2*f^3*x^2 + 2*d^2*e*f^2*x + d^2*e^2*f - 2*f^3)*s 
in(d*x + c))/(a*d^4)
 
3.3.57.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 984 vs. \(2 (88) = 176\).

Time = 2.24 (sec) , antiderivative size = 984, normalized size of antiderivative = 9.94 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Too large to display} \]

input
integrate((f*x+e)**3*cos(d*x+c)**2/(a+a*sin(d*x+c)),x)
 
output
Piecewise((4*d**4*e**3*x*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 
 + 4*a*d**4) + 4*d**4*e**3*x/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 6 
*d**4*e**2*f*x**2*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a* 
d**4) + 6*d**4*e**2*f*x**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d 
**4*e*f**2*x**3*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d* 
*4) + 4*d**4*e*f**2*x**3/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + d**4* 
f**3*x**4*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 
d**4*f**3*x**4/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 8*d**3*e**3/(4* 
a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 12*d**3*e**2*f*x*tan(c/2 + d*x/2) 
**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 12*d**3*e**2*f*x/(4*a*d**4 
*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 12*d**3*e*f**2*x**2*tan(c/2 + d*x/2)**2 
/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 12*d**3*e*f**2*x**2/(4*a*d**4 
*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 4*d**3*f**3*x**3*tan(c/2 + d*x/2)**2/(4 
*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**3*f**3*x**3/(4*a*d**4*tan(c 
/2 + d*x/2)**2 + 4*a*d**4) - 24*d**2*e**2*f*tan(c/2 + d*x/2)/(4*a*d**4*tan 
(c/2 + d*x/2)**2 + 4*a*d**4) - 48*d**2*e*f**2*x*tan(c/2 + d*x/2)/(4*a*d**4 
*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 24*d**2*f**3*x**2*tan(c/2 + d*x/2)/(4*a 
*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 48*d*e*f**2/(4*a*d**4*tan(c/2 + d* 
x/2)**2 + 4*a*d**4) + 24*d*f**3*x*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + 
d*x/2)**2 + 4*a*d**4) - 24*d*f**3*x/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a...
 
3.3.57.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 534 vs. \(2 (97) = 194\).

Time = 0.34 (sec) , antiderivative size = 534, normalized size of antiderivative = 5.39 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {8 \, c^{3} f^{3} {\left (\frac {1}{a d^{3} + \frac {a d^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d^{3}}\right )} - 24 \, c^{2} e f^{2} {\left (\frac {1}{a d^{2} + \frac {a d^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d^{2}}\right )} + 24 \, c e^{2} f {\left (\frac {1}{a d + \frac {a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} - 8 \, e^{3} {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} - \frac {6 \, {\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} e^{2} f}{a d} + \frac {12 \, {\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} c e f^{2}}{a d^{2}} - \frac {6 \, {\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} c^{2} f^{3}}{a d^{3}} - \frac {4 \, {\left ({\left (d x + c\right )}^{3} + 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 6 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} e f^{2}}{a d^{2}} + \frac {4 \, {\left ({\left (d x + c\right )}^{3} + 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 6 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} c f^{3}}{a d^{3}} - \frac {{\left ({\left (d x + c\right )}^{4} + 4 \, {\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 12 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} f^{3}}{a d^{3}}}{4 \, d} \]

input
integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")
 
output
-1/4*(8*c^3*f^3*(1/(a*d^3 + a*d^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + a 
rctan(sin(d*x + c)/(cos(d*x + c) + 1))/(a*d^3)) - 24*c^2*e*f^2*(1/(a*d^2 + 
 a*d^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x 
 + c) + 1))/(a*d^2)) + 24*c*e^2*f*(1/(a*d + a*d*sin(d*x + c)^2/(cos(d*x + 
c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x + c) + 1))/(a*d)) - 8*e^3*(arcta 
n(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*sin(d*x + c)^2/(cos(d*x + 
c) + 1)^2)) - 6*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))* 
e^2*f/(a*d) + 12*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c)) 
*c*e*f^2/(a*d^2) - 6*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + 
 c))*c^2*f^3/(a*d^3) - 4*((d*x + c)^3 + 3*((d*x + c)^2 - 2)*cos(d*x + c) - 
 6*(d*x + c)*sin(d*x + c))*e*f^2/(a*d^2) + 4*((d*x + c)^3 + 3*((d*x + c)^2 
 - 2)*cos(d*x + c) - 6*(d*x + c)*sin(d*x + c))*c*f^3/(a*d^3) - ((d*x + c)^ 
4 + 4*((d*x + c)^3 - 6*d*x - 6*c)*cos(d*x + c) - 12*((d*x + c)^2 - 2)*sin( 
d*x + c))*f^3/(a*d^3))/d
 
3.3.57.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1077 vs. \(2 (97) = 194\).

Time = 0.32 (sec) , antiderivative size = 1077, normalized size of antiderivative = 10.88 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\text {Too large to display} \]

input
integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")
 
output
1/4*(d^4*f^3*x^4*tan(1/2*d*x)^2*tan(1/2*c)^2 + 4*d^4*e*f^2*x^3*tan(1/2*d*x 
)^2*tan(1/2*c)^2 + d^4*f^3*x^4*tan(1/2*d*x)^2 + d^4*f^3*x^4*tan(1/2*c)^2 + 
 6*d^4*e^2*f*x^2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 4*d^3*f^3*x^3*tan(1/2*d*x)^ 
2*tan(1/2*c)^2 + 4*d^4*e*f^2*x^3*tan(1/2*d*x)^2 + 4*d^4*e*f^2*x^3*tan(1/2* 
c)^2 + 4*d^4*e^3*x*tan(1/2*d*x)^2*tan(1/2*c)^2 + 12*d^3*e*f^2*x^2*tan(1/2* 
d*x)^2*tan(1/2*c)^2 + d^4*f^3*x^4 + 6*d^4*e^2*f*x^2*tan(1/2*d*x)^2 - 4*d^3 
*f^3*x^3*tan(1/2*d*x)^2 - 16*d^3*f^3*x^3*tan(1/2*d*x)*tan(1/2*c) + 6*d^4*e 
^2*f*x^2*tan(1/2*c)^2 - 4*d^3*f^3*x^3*tan(1/2*c)^2 + 12*d^3*e^2*f*x*tan(1/ 
2*d*x)^2*tan(1/2*c)^2 + 4*d^4*e*f^2*x^3 + 4*d^4*e^3*x*tan(1/2*d*x)^2 - 12* 
d^3*e*f^2*x^2*tan(1/2*d*x)^2 - 48*d^3*e*f^2*x^2*tan(1/2*d*x)*tan(1/2*c) + 
24*d^2*f^3*x^2*tan(1/2*d*x)^2*tan(1/2*c) + 4*d^4*e^3*x*tan(1/2*c)^2 - 12*d 
^3*e*f^2*x^2*tan(1/2*c)^2 + 24*d^2*f^3*x^2*tan(1/2*d*x)*tan(1/2*c)^2 + 4*d 
^3*e^3*tan(1/2*d*x)^2*tan(1/2*c)^2 + 6*d^4*e^2*f*x^2 + 4*d^3*f^3*x^3 - 12* 
d^3*e^2*f*x*tan(1/2*d*x)^2 - 48*d^3*e^2*f*x*tan(1/2*d*x)*tan(1/2*c) + 48*d 
^2*e*f^2*x*tan(1/2*d*x)^2*tan(1/2*c) - 12*d^3*e^2*f*x*tan(1/2*c)^2 + 48*d^ 
2*e*f^2*x*tan(1/2*d*x)*tan(1/2*c)^2 - 24*d*f^3*x*tan(1/2*d*x)^2*tan(1/2*c) 
^2 + 4*d^4*e^3*x + 12*d^3*e*f^2*x^2 - 24*d^2*f^3*x^2*tan(1/2*d*x) - 4*d^3* 
e^3*tan(1/2*d*x)^2 - 24*d^2*f^3*x^2*tan(1/2*c) - 16*d^3*e^3*tan(1/2*d*x)*t 
an(1/2*c) + 24*d^2*e^2*f*tan(1/2*d*x)^2*tan(1/2*c) - 4*d^3*e^3*tan(1/2*c)^ 
2 + 24*d^2*e^2*f*tan(1/2*d*x)*tan(1/2*c)^2 - 24*d*e*f^2*tan(1/2*d*x)^2*...
 
3.3.57.9 Mupad [B] (verification not implemented)

Time = 2.82 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.86 \[ \int \frac {(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {e^3\,x+\frac {3\,e^2\,f\,x^2}{2}+e\,f^2\,x^3+\frac {f^3\,x^4}{4}}{a}-\frac {d\,\left (6\,x\,\cos \left (c+d\,x\right )\,f^3+6\,e\,\cos \left (c+d\,x\right )\,f^2\right )+d^2\,\left (3\,f^3\,x^2\,\sin \left (c+d\,x\right )+3\,e^2\,f\,\sin \left (c+d\,x\right )+6\,e\,f^2\,x\,\sin \left (c+d\,x\right )\right )-d^3\,\left (e^3\,\cos \left (c+d\,x\right )+f^3\,x^3\,\cos \left (c+d\,x\right )+3\,e^2\,f\,x\,\cos \left (c+d\,x\right )+3\,e\,f^2\,x^2\,\cos \left (c+d\,x\right )\right )-6\,f^3\,\sin \left (c+d\,x\right )}{a\,d^4} \]

input
int((cos(c + d*x)^2*(e + f*x)^3)/(a + a*sin(c + d*x)),x)
 
output
(e^3*x + (f^3*x^4)/4 + (3*e^2*f*x^2)/2 + e*f^2*x^3)/a - (d*(6*e*f^2*cos(c 
+ d*x) + 6*f^3*x*cos(c + d*x)) + d^2*(3*f^3*x^2*sin(c + d*x) + 3*e^2*f*sin 
(c + d*x) + 6*e*f^2*x*sin(c + d*x)) - d^3*(e^3*cos(c + d*x) + f^3*x^3*cos( 
c + d*x) + 3*e^2*f*x*cos(c + d*x) + 3*e*f^2*x^2*cos(c + d*x)) - 6*f^3*sin( 
c + d*x))/(a*d^4)